import numpy as np


class Relu:
    def __init__(self):
        self.x = None

    def forward(self, x):
        self.x = np.maximum(0, x)
        out = self.x
        return out

    def backward(self, dout):
        dx = dout
        dx[self.x <= 0] = 0
        return dx
